package com.watson.patterns.behavior.observer;

public class User implements Observer{
    public String name;
    public String message;

    public User(String name) {
        this.name = name;
    }
    @Override
    public void update(String mesg) {
        this.message = mesg;
        readMsg();
    }

    public void readMsg() {
        System.out.println("read message: " + message);
    }
}
